package com.ypy.context.service.impl;

import com.ypy.context.annotation.Component;
import com.ypy.context.annotation.DI;
import com.ypy.context.annotation.Pea;
import com.ypy.context.dao.impl.UserDaoImpl;
import com.ypy.context.entity.User;
import com.ypy.context.service.UserService;

@Component("userService")
public class UserServiceImpl implements UserService {

	@DI
	private UserDaoImpl userDao;

	@Pea(value = "user")
	public User getUser() {
		return new User("张三", 23);
	}

	@Override
	public void add() {
		System.out.println("》》》 user service impl execute add method...");
		User user = new User("张三", 25);
		userDao.addUser(user);
	}
}
